package com.zhike.b2b.web;

import java.util.ArrayList;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.saas.struts.form.StaffLoginForm;
import com.saas.sys.bpm.TradeQueryIntf;
import com.saas.sys.buffer.Buffers;

//定义名为reload的result重定向到user.action, 其他result则按照convention默认.
public class QueryTradeAction
{
	  private StaffLoginForm slForm;
	  
	  TradeQueryIntf localTradeQueryIntf;
	  
  public String execute(HttpServletRequest request)
  {
  
    Buffers localBuffers1 = new Buffers();
    Buffers localBuffers2 = new Buffers();
    
    HttpSession session = request.getSession();
    localBuffers1.convert(request, slForm, session);
    ArrayList localArrayList = new ArrayList();
    localArrayList = localTradeQueryIntf.ExecTradeQuery(localBuffers1);
    localBuffers2 = localTradeQueryIntf.getOutBuffer();
    Map localMap = request.getParameterMap();
    request.setAttribute("query", localMap);
    request.setAttribute("result", localArrayList);
    
    request.setAttribute("outBuffer", localBuffers2);
    String str = "";
    if (session.getAttribute("SESSION_CUST_ID") != null)
      str = session.getAttribute("SESSION_CUST_ID").toString();
    if (str.equals(""))
      return "ERROR_PAGE";
    return "QUERY_PAGE";
  }
  
  public StaffLoginForm getSlForm() {
  	return slForm;
  }

  public void setSlForm(StaffLoginForm slForm) {
  	this.slForm = slForm;
  }

}

